package xyz.yuanjilu.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import xyz.yuanjilu.dao.BpmNodeRuleDao;
import xyz.yuanjilu.entity.BpmNodeRuleEntity;
import xyz.yuanjilu.service.BpmNodeRuleService;
import xyz.yuanjilu.utils.BPMConstant;
import xyz.yuanjilu.utils.UuidUtil;



@Service("bpmNodeRuleService")
public class BpmNodeRuleServiceImpl implements BpmNodeRuleService {
	@Autowired
	private BpmNodeRuleDao bpmNodeRuleDao;
	
	@Override
	public BpmNodeRuleEntity queryObject(String id){
		return bpmNodeRuleDao.queryObject(id);
	}
	
	@Override
	public List<BpmNodeRuleEntity> queryList(Map<String, Object> map){
		return bpmNodeRuleDao.queryList(map);
	}
	
	@Override
	public int queryTotal(Map<String, Object> map){
		return bpmNodeRuleDao.queryTotal(map);
	}
	
	@Override
	public void save(BpmNodeRuleEntity bpmNodeRule){
		bpmNodeRule.setId(UuidUtil.get15UUID());
		bpmNodeRule.setBpmDeploymentId(BPMConstant.MODEL_RULE_INIT_DEPLOYMENTID);
		bpmNodeRuleDao.save(bpmNodeRule);
	}
	
	@Override
	public void update(BpmNodeRuleEntity bpmNodeRule){
		bpmNodeRuleDao.update(bpmNodeRule);
	}
	
	@Override
	public void delete(String id){
		bpmNodeRuleDao.delete(id);
	}
	
	@Override
	public void deleteBatch(String[] ids){
		bpmNodeRuleDao.deleteBatch(ids);
	}
	
}
